﻿using GraphProcessor;
using IQIGame.Onigao.Logic;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay.Editors
{
    [System.Serializable, NodeMenuItem(SkillEditorConst.SkillEffective + "/" + SkillEditorConst.Package + "/" + SkillEditorConst.CustomPropertyInt, typeof(SkillEditorGraph))]
    public class EffectivePackageNode_CustomProperty: EffectivePackageNode_Base
    {
        [InspectorName("自定义属性类型")] public ECustomProperty property = ECustomProperty.CustomTempInt;
        [InspectorName("自定义key")] public string customKey = string.Empty;
        [Input("修改类型")] public SkillEffective_CustomPropertyInt.ECustomPropertyChangeType changeType;
        [Input("层数")] public SkillEffectiveAction_ParamNum stack;
        
        protected override ESkillEffectiveType actionType => ESkillEffectiveType.CustomPropertyInt;

        protected override SkillCustomConfig CreateConfig()
        {
            var rConfig = new SkillEffectiveAction_CustomProperty_ConfigData()
            {
                propertyKey = (int)this.property,
                customKey = this.customKey,
                type = (int)this.changeType,
                value = this.stack
            };
            return rConfig;
        }
    }
}